// 模拟 StudentDictVO
const mockStudentDictVO = {
  id: Math.floor(Math.random() * 1000000),
  name: 'Student 1',
  username: 'student1',
}

// 模拟 CourseDictVO
const mockCourseDictVO = {
  id: Math.floor(Math.random() * 1000000),
  name: 'Course 1',
}

// 模拟 LessonVO
// 模拟 LessonDateGroupVO
const mockLessonDateGroupVO1 = {
  lessonDate: '2025-03-03',
  experienceLessonNum: 2,
  signupLessonNum: 5,
  reviewLessonNum: 1,
  lessons: [{
    lessonId: 1,
    type: 1,
    scheduledStartTime: new Date().getTime(),
    scheduledEndTime: new Date(new Date().getTime() + 3600000).getTime(),
    actuallyStartTime: null,
    actuallyEndTime: null,
    student: mockStudentDictVO,
    courses: [mockCourseDictVO],
  },
  ],
}

const mockLessonDateGroupVO2 = {
  lessonDate: '2025-03-04',
  experienceLessonNum: 2,
  signupLessonNum: 5,
  reviewLessonNum: 1,
  lessons: [{
    lessonId: 1,
    type: 2,
    scheduledStartTime: new Date().getTime(),
    scheduledEndTime: new Date(new Date().getTime() + 3600000).toISOString(),
    actuallyStartTime: null,
    actuallyEndTime: null,
    student: mockStudentDictVO,
    courses: [mockCourseDictVO],
  },
  ],
}

const mockLessonDateGroupVO4 = {
  lessonDate: '2025-03-09',
  experienceLessonNum: 2,
  signupLessonNum: 5,
  reviewLessonNum: 1,
  lessons: [{
    lessonId: 1,
    type: 2,
    scheduledStartTime: new Date().getTime(),
    scheduledEndTime: new Date(new Date().getTime() + 3600000).toISOString(),
    actuallyStartTime: null,
    actuallyEndTime: null,
    student: { id: -1, name: '没有学习记录去课程列表', username: '没有学习记录' },
    courses: [mockCourseDictVO],
  },
  ],
}

const mockLessonDateGroupVO3 = {
  lessonDate: '2025-03-05',
  experienceLessonNum: 2,
  signupLessonNum: 5,
  reviewLessonNum: 1,
  lessons: [{
    lessonId: 1,
    type: 3,
    scheduledStartTime: new Date().getTime(),
    scheduledEndTime: new Date(new Date().getTime() + 3600000).toISOString(),
    actuallyStartTime: null,
    actuallyEndTime: null,
    student: mockStudentDictVO,
    courses: [mockCourseDictVO],
  },
  ],
}

// 模拟 LessonCollectionVO
const mockLessonCollectionVO = {
  hasMore: false,
  cursor: 20,
  list: [mockLessonDateGroupVO1, mockLessonDateGroupVO2, mockLessonDateGroupVO3],
}

// 模拟完整的响应数据
const mockResponseData = {
  code: 0,
  message: 'Success',
  data: mockLessonCollectionVO,
  timestamp: Date.now(),
  requestId: 'req-123456',
  signature: 'sig-abcdef',
}

// 使用示例
const mockedData = mockResponseData
let index = 0
export default function () {
  return new Promise((resolve) => {
    setTimeout(() => {
      index++
      mockedData.data.cursor = index
      if (index > 5) {
        mockedData.data.hasMore = false
      }
      resolve(mockedData)
    }, 300)
  })
}
